$(function () {
    init();

    function init() {
        getMenu();
        getRec();
    }
    // 首页菜单渲染
    function getMenu() {
        $.ajax({
            type: "get",
            url: "http://193.112.55.79:9090/api/getindexmenu",
            success: function (result) {
                // console.log(result)
                let data = result.result;

                console.log(data);
                let html = template("menuTpl", {
                    arr: data
                });
                $("#menu").html(html);
            }
        });
    }

    // 超值折扣
    function getRec() {
        $.ajax({
            type: "get",
            url: "http://193.112.55.79:9090/api/getmoneyctrl",
            success: function (result) {
                // console.log(result)
                let data = result.result;
                console.log(data);
                let html = template("recTpl", {
                    arr: data
                });
                $("#recommen").html(html);

            }
        });
    }
})